package net.modul.dept.service;

import com.beyond.exception.XException;

import net.common.service.GeneralService;
import net.modul.dept.dao.EmployeeDao;
import net.modul.dept.dao.impl.EmployeeDaoImpl;
import net.modul.dept.vo.EmployeeVo;

/**
 * 员工编辑业务处理
 * 
 * @author Administrator
 * 
 */
public class EmployeeEditorService extends GeneralService {

	private EmployeeVo bean;

	@Override
	public void execute() throws XException {
		EmployeeDao dao = new EmployeeDaoImpl();
		try{
		if(bean.getEmpl_id() != null) {
			dao.update(bean);
		} else {
			bean.setFlag(0);
			dao.insert(bean);
		}
		}catch(Exception e){
			throw new XException(e);
		}
	}

	public void setBean(EmployeeVo bean) {
		this.bean = bean;
	}

}
